# $Id$
# Maintainer: Jan de Groot  <jgc@archlinux.org>

pkgname=libgweather
pkgver=3.24.1+1+g9b08eea
pkgrel=1
pkgdesc="Location and timezone database and weather-lookup library"
url="https://wiki.gnome.org/Projects/LibGWeather"
arch=(i686 x86_64)
license=(LGPL)
depends=(libsoup gtk3 geocode-glib dconf)
makedepends=(intltool gobject-introspection vala git gtk-doc autoconf-archive glade)
options=(!emptydirs)
_commit=9b08eeadf215580358d0f53ac0f54c9acdde7384  # master
source=("git+https://git.gnome.org/browse/libgweather#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd "$pkgname"

  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --disable-static --enable-gtk-doc

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd "$pkgname"
  make DESTDIR="$pkgdir" install
}
